﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleData.ObjectModel.Design
{
	/// <summary>
	/// 
	/// </summary>
	public class FieldRule : Rule
	{

		protected FieldRule()
			: base( new RuleName( "field" ) )
		{ }

		public FieldRule( RuleName name, FieldDescriptor field )
			: base( name )
		{
			field.Throws().IfNull();
			this.Field = field;
			this.Type = RuleKind.Field;
		}

		/// <summary>
		/// Obtém ou define o campo que possui a regra
		/// </summary>
		public FieldDescriptor Field
		{
			get;
			protected set;
		}
	}

	
}
